function [isok, source_dir, backup_loc] = primary_backup_define(email)

isok = 0;
[~,host] = dos('hostname');
host = lower(strtrim(host));

switch host
    case 'keller-rig1-2pi'
        use_rig=1;
        
    case 'keller-rig2-2pi'
        use_rig=2;
        
    otherwise
        use_rig=input('Which Rig would you like to backup data from: ');
end

if use_rig==1
    source_dir{1} = '\\KELLER-RIG1-2PI\tempData\tempData';
    source_dir{2} = '\\KELLER-RIG1-AUX\tempData';
    source_dir{3} = '\\F410I-993467\stims';
    
    backup_loc{1} = '\\KELLER-RIG1-ANA\RawData';
    backup_loc{2} = '\\KELLER-RIG2-AUX\RawData';
elseif use_rig==2
    source_dir{1} = '\\KELLER-RIG2-2PI\tempData';
    source_dir{2} = '\\KELLER-RIG2-AUX\tempData';
    %         source_dir{3} = '\\F410I-993467\stims';
    
    backup_loc{1} = '\\KELLER-RIG1-ANA\RawData';
    backup_loc{2} = '\\KELLER-RIG2-AUX\RawData';
else
    error('oh oh')
end

if email
    setpref('Internet', 'E_mail', 'gkellerlab@gmail.com');
    setpref('Internet', 'SMTP_Username', 'gkellerlab@gmail.com');
    setpref('Internet', 'SMTP_Password', 'Keller123');
    setpref('Internet', 'SMTP_Server', 'smtp.gmail.com');
    props = java.lang.System.getProperties;
    props.setProperty('mail.smtp.auth','true');
    props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
    props.setProperty('mail.smtp.socketFactory.port', '465');
end

disp(['I''m ' deblank(host) '. Nice to see you! Let''s see whether everything is all right.']);

no_backup_loc = size(backup_loc,2);

for ind = 1:no_backup_loc
    fprintf('%s%s',backup_loc{ind},char(13))
end
answer = input('These ones are your backup locations. Correct [y/n]? ','s');
if strcmpi(deblank(answer),'y') || isempty(strtrim(answer))
    isok = 1;
else
    disp('Aborting ...')
    isok = 0;
    return
end
